package com.kgc.storeconsumer.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.store.pojo.InventoryLossDetail;
import com.kgc.store.pojo.OutStore;
import com.kgc.storeconsumer.feign.InventoryLossDetailFeign;
import com.kgc.storeconsumer.feign.OutStoreFeign;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
@CrossOrigin("*")
@RequestMapping("/inventoryLossDetail")
public class InventoryLossDetailController {
    private Logger logger = LoggerFactory.getLogger(getClass());
    @Autowired
    private InventoryLossDetailFeign inventoryLossDetailFeign;

    @RequestMapping("getInventoryLossDetailList")
    @ResponseBody
    public ResponseMsg getInventoryLossDetailList(String inventoryLossCode){
        logger.info("InventoryLossDetailController getInventoryLossDetailList inventoryLossCode:"+inventoryLossCode);
        ResponseMsg msg =inventoryLossDetailFeign.getInventoryLossDetailList(inventoryLossCode);
        logger.debug("InventoryLossDetailController getInventoryLossDetailList msg:"+msg);
        return msg;
    }

    @RequestMapping("delInventoryLossDetail")
    @ResponseBody
    public ResponseMsg delInventoryLossDetail(String inventoryLossCode){
        logger.info("InventoryLossDetailController delInventoryLossDetail inventoryLossCode:"+inventoryLossCode);
        ResponseMsg msg =inventoryLossDetailFeign.delInventoryLossDetail(inventoryLossCode);
        logger.debug("InventoryLossDetailController delInventoryLossDetail msg:"+msg);
        return msg;
    }

    @RequestMapping("insertInventoryLossDetail")
    @ResponseBody
    ResponseMsg insertInventoryLossDetail(@RequestBody InventoryLossDetail inventoryLossDetail){
        logger.info("InventoryLossDetailController insertInventoryLossDetail inventoryLossDetail:"+inventoryLossDetail);
        ResponseMsg msg =inventoryLossDetailFeign.insertInventoryLossDetail(inventoryLossDetail);
        logger.debug("InventoryLossDetailController insertInventoryLossDetail msg:"+msg);
        return msg;
    }
}
